﻿<ss:SlWindow x:Class="SmartSpace.UI.Silverlight.Dynamic.Windows.SelectReceiverWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:ss="clr-namespace:SmartSpace.UI.Silverlight;assembly=SmartSpace.UI.Silverlight"
           Width="400" Height="300"
           Title="SelectReceiverWindow">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ListBox Grid.Row="0" Name="_ctlListUser">
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <RadioButton GroupName="WorkflowUser" Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalContentAlignment="Stretch"
              IsChecked="{Binding Path=IsSelected,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Name}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
            <Button x:Name="OKButton" Click="OKButton_Click">
                <StackPanel>
                    <Image Source="../Resources/Accept.png" Margin="0,0,5,0"/>
                    <TextBlock Text="选择"/>
                </StackPanel>
            </Button>
            <Button x:Name="CancelButton" Click="CancelButton_Click">
                <StackPanel>
                    <Image Source="../Resources/Accept.png" Margin="0,0,5,0"/>
                    <TextBlock Text="关闭"/>
                </StackPanel>
            </Button>
        </StackPanel>
    </Grid>
</ss:SlWindow>